<template>
	<view class="content">
		<view class="form">
			<view class="titel">
				修改订单产品工序分配任务
			</view>
			<view class="itembox">
				<view class="name">
					工序名称:
				</view>
				<view class="inputBox">
					<input type="text" v-model="info.name" placeholder="请填写工序名称"  />
				</view>
			</view>
			<view class="itembox" v-if="checkPermi(['develop:LnGongxu:edit'])">
				<view class="name">
					单价:
				</view>
				<view class="inputBox">
					<input type="number" v-model="info.money" placeholder="请填写单价" />
				</view>
			</view>
			<view class="itembox">
				<view class="name">
					图纸号:
				</view>
				<view class="inputBox">
					<input type="text" v-model="info.shuoming" placeholder="请填写图纸号" />
				</view>
			</view>
			<view class="itembox">
				<view class="name">
					备注:
				</view>
				<view class="inputBox">
					<input type="text" v-model="info.remark" placeholder="请填写备注" />
				</view>
			</view>
		</view>
		<view class="bottom-box">
			<view class="bnt" @click="addBnt()">
				确定
			</view>
		</view>
	</view>
</template>

<script>
	import * as index from '@/api/index.js'
	export default {
		data() {
			return {
				info:{},
				id: '',
			}
		},
		onLoad(e) {
			if(e.id) {
				this.id = e.id
				this.getList()
			}
			if(e.info) {
				this.info = JSON.parse(e.info)
			}
			// this.getInfo()
		},
		methods: {
			// 查询列表数据
			getList() {
				// var id = this.ids.split(",")
				// console.log(this.getDataType(this.ids))
				index.listSaleProByPhone({
					id: this.id
				}).then(res => {
					this.info = res.rows[0]
				})
			},
			onKeyInput (event) {
				this.info.errorCount = event.target.value
				// this.info.allMoney = event.target.value*this.info.money
			},
			addBnt(e) {
				uni.showModal({
					title: '提示',
					content: '确定提交吗？',
					success :(res)=> {
						if (res.confirm) {
							index.goodsSaledoGongxuUserPriceEdit(this.info).then(res=>{
								setTimeout(res=>{
									uni.navigateBack()
								},100)
							})
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
		}

	}
</script>

<style lang="scss">
	.content {
		padding-left: 20rpx;
		padding-right: 20rpx;
		.form {
			margin-top: 20rpx;
			padding: 20rpx;
			background-color: #ffffff;
			border-radius: 10rpx;
			.titel {
				padding-top: 30rpx;
				padding-bottom: 30rpx;
				color: #333;
				font-size: 28rpx;
				font-weight: bold;
			}
			.itembox {
				border-top: 1px solid #EDEDED;
				display: flex;
				align-items: center;
				padding-top: 30rpx;
				padding-bottom: 30rpx;
				.name {
					text-align: right;
					width: 160rpx;
					color: #999;
					font-size: 28rpx;
				}
				.inputBox {
					padding-left: 20rpx;
					width: 600rpx;
					color: #333;
					font-size: 28rpx;
				}
			}
		}
		.bottom-box {
			position: fixed;
			bottom: 0;
			left: 0;
			width: 750rpx;
			padding: 30rpx;
			padding-bottom: 120rpx;
			height: 120rpx;
			background: #ffffff;
			display: flex;
			justify-content: center;
			.bnt {
				color: #ffffff;
				width: 306rpx;
				height: 88rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				border-radius: 10rpx;
				background: #4D8987;
			}
		}
	}
</style>